Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent overwriting the DevWorkspace Operator Config by the Dashboard #984

Merged
merged 2 commits into from
Nov 22, 2023

Conversation

akurinnoy
Copy link
Contributor

What does this PR do?

This PR fixes the workspace startup process to prevent the Dashboard from overwriting the DevWorkspace Operator Config attribute every time the workspace starts.

What issues does this PR fix or reference?

fixes eclipse-che/che#22573

Is it tested? How?

  1. Create a DWOC object in your workspaces namespace:
    apiVersion: controller.devfile.io/v1alpha1
    kind: DevWorkspaceOperatorConfig
    metadata:
      name: custom-dwoc
      namespace: <your-namespace>
    config:
      workspace:
        persistUserHome:
          enabled: true
  2. Reference the DWOC from a devfile:
    schemaVersion: 2.2.0
    metadata:
      name: my-app
    + attributes:
    +   controller.devfile.io/devworkspace-config:
    +     name: custom-dwoc
    +     namespace: <your-namespace>
    components:
  3. Create the workspace and verify it has a correct reference to the DWOC specified:
    $ kubectl get dw -o json | jq '.items[0].spec.template.attributes."controller.devfile.io/devworkspace-config"'
    {
      "name": "custom-dwoc",
      "namespace": "<your-namespace>"
    }

Signed-off-by: Oleksii Kurinnyi <[email protected]>
@akurinnoy akurinnoy self-assigned this Nov 10, 2023
@che-bot
Copy link
Contributor

che-bot commented Nov 10, 2023

Click here to review and test in web IDE: Contribute

Copy link

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-984

@akurinnoy
Copy link
Contributor Author

/retest

1 similar comment
@ibuziuk
Copy link
Member

ibuziuk commented Nov 16, 2023

/retest

Copy link

codecov bot commented Nov 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4e2738d) 85.15% compared to head (0154a64) 85.35%.
Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #984      +/-   ##
==========================================
+ Coverage   85.15%   85.35%   +0.19%     
==========================================
  Files         380      380              
  Lines       39189    39190       +1     
  Branches     2522     2532      +10     
==========================================
+ Hits        33373    33449      +76     
+ Misses       5789     5715      -74     
+ Partials       27       26       -1     
Flag Coverage Δ
unittests 85.35% <100.00%> (+0.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ibuziuk
Copy link
Member

ibuziuk commented Nov 16, 2023

/retest

Copy link
Member

@ibuziuk ibuziuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akurinnoy looks good, but can we possibly add some tests for this functionality?

@akurinnoy
Copy link
Contributor Author

@ibuziuk good point!

Copy link

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-984

@akurinnoy
Copy link
Contributor Author

@ibuziuk tests have been added.

Copy link
Contributor

@olexii4 olexii4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ibuziuk
Copy link
Member

ibuziuk commented Nov 21, 2023

/retest

Copy link

openshift-ci bot commented Nov 21, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: akurinnoy, ibuziuk, olexii4

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@akurinnoy akurinnoy merged commit 845b30f into main Nov 22, 2023
13 checks passed
@akurinnoy akurinnoy deleted the preserve-dwoc branch November 22, 2023 08:48
@devstudio-release
Copy link

Build 3.11 :: dashboard_3.x/401: Console, Changes, Git Data

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

Build 3.11 :: dashboard_3.x/401: SUCCESS

Upstream sync done; /DS_CI/sync-to-downstream_3.x/5348 triggered

@devstudio-release
Copy link

@devstudio-release
Copy link

Build 3.11 :: update-digests_3.x/4978: UNSTABLE

No new images detected: nothing to do!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Devfile DevWorkspace Operator Config is overwritten by the dashboard
5 participants